Skip to content

test_runner: display diagnostic messages in dot reporter#64331

Open
armorbreak001 wants to merge 1 commit into
nodejs:mainfrom
armorbreak001:fix/test-runner-dot-diagnostics
Open

test_runner: display diagnostic messages in dot reporter#64331
armorbreak001 wants to merge 1 commit into
nodejs:mainfrom
armorbreak001:fix/test-runner-dot-diagnostics

Conversation

@armorbreak001

@armorbreak001 armorbreak001 commented Jul 6, 2026

Copy link
Copy Markdown

Problem

When running tests with both the dot reporter (--test-reporter dot) and coverage enabled, if coverage setup or collection fails, the process exits with a non-zero status code but shows no output explaining why. The user only sees test dots and then an unexplained failure.

Proposed Fix

Collect test:diagnostic events in the dot reporter and display them after the test results (similar to how failed tests are shown). This ensures coverage warnings and other diagnostic messages are visible.

Changes

lib/internal/test_runner/reporter/dot.js:

  • Added diagnostics[] array to collect diagnostic events
  • Handle test:diagnostic type in the event loop
  • Display diagnostics section after failed tests section (yellow ! prefix)

Before

.....X....X......
Failed tests:  ...
$ echo $?
1
# No indication of WHY it failed if coverage was the issue

After

.....X....X......
Failed tests:  ...

Diagnostics:

! Warning: Code coverage could not be enabled. ...
! Warning: Could not report code coverage. ...
$ echo $?
1

Approach

  • Follows the same pattern as existing failed tests collection/display
  • Uses yellow color to differentiate from red failures
  • Minimal change — only adds diagnostic event handling
  • Consistent with how spec reporter already handles diagnostics

Fixes: #60884

When using the dot reporter with coverage enabled, coverage failures
would silently exit with an error code but show no output explaining
the failure. This change collects and displays diagnostic messages
(including coverage warnings) after the test dots, similar to how
failed tests are displayed.

Fixes: nodejs#60884
Signed-off-by: armorbreak001 <contact@agentvote.cc>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 6, 2026
@atlowChemi

Copy link
Copy Markdown
Member
  1. This is a duplicate of test_runner: print coverage and diagnostic info with dot reporter #61423
  2. This needs to have some test (snapshots, probably)
  3. The Fixes: footer should contain a full URL, not just the issue number (ie. #60884 -> https://github.com/nodejs/node/issues/60884)

@armorbreak001

Copy link
Copy Markdown
Author

Thanks for the review @atlowChemi!

I've updated the Fixes: footer to use the full URL as suggested.

Regarding the duplicate concern: I see #61423 adds both diagnostic and coverage event handling to the dot reporter. This PR focuses specifically on test:diagnostic events (coverage warnings, setup failures, etc.) which is the most critical gap — when coverage fails silently, users have zero indication of what went wrong. I kept it intentionally minimal to make it easier to review and merge.

That said, if you'd prefer to track this under #61423, I'm happy to close this one. Just let me know!

For tests: I'll add snapshot tests for the dot reporter diagnostic output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_runner: print failed coverage reports with dot runner

4 participants